﻿using BasicInformationWrite.API.BasicInformationCommons.Warehousees;
using ERPSystem.Common.Domains.WarehouseCommon;
using ERPSystem.Common.DTO;
using ERPSystem.Common.Infrastructure.IRepository;
using ERPSystem.Enum.CommonErrorCodes;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace BasicInformationWrite.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class WarehouseController : ControllerBase
    {
        private readonly IMediator _mediator;

        public WarehouseController(IMediator mediator)
        {
            _mediator = mediator;
        }
        /// <summary>
        /// 新增仓库业务逻辑
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> WarehouseCreate(WarehouseCreateCommand request, CancellationToken cancellationToken)
        {
            var result =await _mediator.Send(request);
            return result;
        }
    }
}
